package kr.kwakyc.puzzle;

public enum Level {
	
	EASY("초급"), NORMAL("중급"), HARD("고급");
	
	private String value;
	Level(String value){
		this.value = value;
	}
	
	public String getValue(){
		return this.value;
	}
	
	public static String[] getLevelNames(){
		Level[] levels = Level.values();
		String[] levelNames = new String[levels.length];
		
		for(int i = 0; i < levels.length; i++){
			levelNames[i] = levels[i].getValue();
		}
		
		return levelNames;
	}
	
	public static Level findByStringValue(String stringValue){
		Level findLevel = Level.EASY;
		
		for(Level level : Level.values()){
			if(stringValue.equals(level.value))		findLevel = level;
		}
		
		return findLevel;
	}
}
